home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / MENU.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  1KB  |  33 lines

  1. ' MENU.BAS
  2. ' This program demonstrates the LEN function.
  3.  
  4. missMuffet$ = "Curds and Whey"         ' declare meal strings
  5. simpleSimon$ = "Pie du Jour"
  6. petersPlate$ = "Pumpkin Surprise"
  7.  
  8. CLS
  9.                                                                         
  10. PRINT "Which meal would you enjoy?"    ' display meal prompt
  11. PRINT
  12.  
  13. PRINT missMuffet$                      ' display meal choices
  14. PRINT simpleSimon$
  15. PRINT petersPlate$
  16. PRINT
  17.  
  18. INPUT "Selection:  ", choice$          ' get meal choice from user
  19. choice$ = UCASE$(choice$)              ' convert string to uppercase
  20. PRINT
  21.  
  22. SELECT CASE choice$                    ' find variable that matches
  23.     CASE IS = UCASE$(missMuffet$)      '   meal entered and print length
  24.         PRINT missMuffet$; " is"; LEN(missMuffet$); "characters long"
  25.     CASE IS = UCASE$(simpleSimon$)
  26.         PRINT simpleSimon$; " is"; LEN(simpleSimon$); "characters long"
  27.     CASE IS = UCASE$(petersPlate$)
  28.         PRINT petersPlate$; " is"; LEN(petersPlate$); "characters long"
  29.     CASE ELSE                          ' print message if no match found
  30.         PRINT "I don't recognize that meal!"
  31. END SELECT
  32.  
  33.